//
//  JSPictureManager.m
//  NiubilityProject
//
//  Created by Apple on 2017/11/30.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "JSPictureManager.h"
#import "CuiPickerView.h"
#import <TZImageManager.h>

@interface JSPictureManager ()

@property (nonatomic, strong) CuiPickerView *cuiPickerView;
@end

@implementation JSPictureManager



+ (void)showDefauldPickerViewControllerTarget:(UIViewController *)target maxCount:(NSInteger)maxCount{
    TZImagePickerController *picker = [[TZImagePickerController alloc] initWithMaxImagesCount:maxCount delegate:target];
    picker.allowPickingVideo = NO;
    [target.navigationController presentViewController:picker animated:YES completion:nil];
    
}
+ (void)showUseriConPickerViewControllerTarget:(UIViewController *)target cropRect:(CGRect)cropRect isUseDefauld:(BOOL) isDefuald{
    TZImagePickerController *picker = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:target];
    if (isDefuald) {
        cropRect = CGRectMake(0, (SCREEN_HEIGHT - SCREEN_WIDTH)*0.5, SCREEN_WIDTH, SCREEN_WIDTH);
    }
    picker.allowPickingVideo = NO;
    picker.allowCrop = YES;
    picker.cropRect = cropRect;
    picker.cropRectPortrait = picker.cropRect;
    [target.navigationController presentViewController:picker animated:YES completion:nil];
}
+(JSPictureManager *)showDatePickerViewController:(UIViewController *)target frame:(CGRect)frmae{
    JSPictureManager *manager = [JSPictureManager new];
  manager.cuiPickerView = [[CuiPickerView alloc]init];
    manager.cuiPickerView.frame = frmae;
    manager.cuiPickerView.delegate = target;
    manager.cuiPickerView.curDate=[NSDate date];
    [manager.cuiPickerView showMaskView];
    return manager;
}
@end
